﻿<Window x:Class="OpenExpressApp.Shell"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:AvalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"
    xmlns:local="clr-namespace:OpenExpressApp"
    xmlns:c="http://www.caliburnproject.org"
    Title="主窗体" Height="Auto" Width="900" WindowState="Maximized"
    xmlns:themes="clr-namespace:OpenExpressApp.WPF.Themes;assembly=OpenExpressApp.Module.WPF.Style" Opacity="0.3"
    themes:ThemeManager.Theme="{Binding ElementName=themes, Path=SelectedItem}">
    <Window.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF83BBF4" Offset="0"/>
            <GradientStop Color="#FF83BBF4" Offset="0.992"/>
            <GradientStop Color="#FF2873BE" Offset="0.085"/>
        </LinearGradientBrush>
    </Window.Background>
    <Window.Triggers>
        <EventTrigger RoutedEvent="Window.Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation Duration="00:00:1" Storyboard.TargetProperty="Opacity" To="1" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Window.Triggers>
    <DockPanel>
        <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" >
            <TextBlock Foreground="White" VerticalAlignment="Center" FontSize="20">开源信息平台 OpenExpressApp by 周金根</TextBlock>
            <Label Margin="20,0,0,0" Foreground="White" VerticalAlignment="Center">当前用户：</Label>
            <TextBlock x:Name="txtUserName" Foreground="White" VerticalAlignment="Center">未登录</TextBlock>
            <Button Margin="20,4,4,4" Name="btnModifyPwd" Click="btnModifyPwd_Click">修改密码</Button>
            <Button Margin="4" Name="btnHelp"  Click="btnHelp_Click">帮助</Button>
            <Button Margin="4" Name="btnAbout" Click="btnAbout_Click">关于</Button>
        </StackPanel>
        <StackPanel HorizontalAlignment="Right" DockPanel.Dock="Bottom" Orientation="Horizontal" >
            <TextBlock VerticalAlignment="Center">缩放</TextBlock>
            <Slider x:Name="sdScale" Width="50"  Value="1" Minimum="0.8" Maximum="2" MouseDoubleClick="sdScale_MouseDoubleClick" />
            <ComboBox x:Name="themes" Width="150" Height="20" SelectedIndex="0" />
            <TextBlock x:Name="txtServer" VerticalAlignment="Center"></TextBlock>
        </StackPanel>
        <ContentControl>
            <ContentControl.LayoutTransform>
                <ScaleTransform CenterX="0" CenterY="0" 
                    ScaleX="{Binding ElementName=sdScale, Path=Value}" 
                    ScaleY="{Binding ElementName=sdScale, Path=Value}"/>
            </ContentControl.LayoutTransform>
            <AvalonDock:DockingManager x:Name="_dockingManager" >
                <AvalonDock:ResizingPanel>
                    <AvalonDock:DockablePane AvalonDock:ResizingPanel.ResizeWidth="228" x:Name="tools">
                    </AvalonDock:DockablePane>
                    <AvalonDock:ResizingPanel Orientation="Vertical">
                        <AvalonDock:DocumentPane x:Name="workspace"/>
                        <AvalonDock:DockablePane AvalonDock:ResizingPanel.ResizeHeight="300" x:Name="pads"/>
                    </AvalonDock:ResizingPanel>
                </AvalonDock:ResizingPanel>
            </AvalonDock:DockingManager>
        </ContentControl>
    </DockPanel>
</Window>
